import Vue from 'vue';

import VueRouter from 'vue-router';
// import Home from '../views/Home.vue';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../pages/index/index.vue'),
    meta: {
      title: '首页'
    }
  },
  
];

const router = new VueRouter({
  routes
});
router.beforeEach((to, from, next) => {
  const title = to.meta && to.meta.title;
  if (title) {
    document.title = title;
  }
  next();
});
export default router;
